package com.bfly.mall.product.dto;

import com.bfly.core.config.ResourceConfigure;
import com.bfly.mall.product.enums.ProductActivityStatusEnum;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 秒杀产品列表
 *
 * @author 长沙商脉科技有限公司
 * @date 2021/2/2 12:56
 */
public class ProductSecKillListDTO implements Serializable {

    private static final long serialVersionUID = -6154219496988252452L;

    private int id;
    private int productId;
    private String sn;
    private String productName;
    private String speAttr;
    private String logo;
    private boolean enabled;
    private String name;
    private BigDecimal price;
    private int total;
    private int sales;
    private int limits;
    private String rules;
    private int status;
    private Date startTime;
    private Date endTime;
    private int seq;

    public String getUrl() {
        return StringUtils.isNotBlank(getLogo()) ? ResourceConfigure.getResourceHttpUrl(getLogo()) : "";
    }

    public String getStatusName() {
        ProductActivityStatusEnum statusEnum = ProductActivityStatusEnum.getActivityStatusEnum(getStatus());
        return statusEnum == null ? "" : statusEnum.getName();
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getSpeAttr() {
        return speAttr;
    }

    public void setSpeAttr(String speAttr) {
        this.speAttr = speAttr;
    }

    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    public String getLogo() {
        return logo;
    }

    public void setLogo(String logo) {
        this.logo = logo;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSales() {
        return sales;
    }

    public void setSales(int sales) {
        this.sales = sales;
    }

    public int getLimits() {
        return limits;
    }

    public void setLimits(int limits) {
        this.limits = limits;
    }

    public String getRules() {
        return rules;
    }

    public void setRules(String rules) {
        this.rules = rules;
    }
}
